<extend name="Public/base" />

<block name="body">

    <div class="main-title">
        <h2>战队 队员列表 <button class="btn btn-default btn-return" onclick="javascript:history.back(-1);return false;"><i class="glyphicon glyphicon-share-alt"></i> 返 回</button></h2>
    </div>
    <div></div>
    <br/>
    <div class="cf">
        <div class="fl">
            <a title="新增" class="btn btn-primary" href="{:U('add?team_id='.$team_id)}"><i class="glyphicon glyphicon-plus"></i></a>
            <button class="btn btn-danger ajax-post confirm" url="{:U('del')}" target-form="ids">删 除</button>
        </div>

        <!-- 高级搜索 -->
    </div>
    <!-- 数据列表 -->
    <div class="data-table table-striped">
    <table class="table table-bordered">
    <thead>
        <tr>
        <th class="row-selected row-selected"><input class="check-all" type="checkbox"/></th>
        <th class="">游戏角色名</th>
        <th class="">姓名</th>
        <th class="">66play ID</th>
        <th class="">排序</th>
        <th width="300" class="">操作</th>
        </tr>
    </thead>
    <form action="{:U('sort?team_id='.$team_id)}" method="post" class="form">
    <tbody>
        <notempty name="_list">
        <volist name="_list" id="vo">
        <tr>
            <td width="1%"><input class="ids" type="checkbox" name="id[]" value="{$vo.id}" /></td>
            <td width="3%">
                {$vo.name}
            </td>
            <td width="3%">
                {$vo.real_name}
            </td>
            <td width="3%">
                {$vo.user_id}
            </td>
            <td width="10%">
                <input class="text form-control input-small" name="sort[{$vo.id}]" value="{$vo.sort|default=0}" />
            </td>
            <td width="24%">
                <a class="btn btn-default btn-xs" title="编辑" href="{:U('edit?team_id='.$team_id.'&id='.$vo['id'])}"><i class="glyphicon glyphicon-pencil"></i></a>
                <a href="{:U('del?id='.$vo['id'])}" class="confirm ajax-get btn btn-danger btn-xs"><i class="glyphicon glyphicon-trash"></i></a>
            </td>
        </tr>
        </volist>
        <else/>
        <td colspan="5" class="text-center"> aOh! 暂时还没有内容! </td>
        </notempty>
    </tbody>
    </table>
    </div>
    <br><br>
    <div class="form-item form-group form-action">
        <button class="btn submit-btn ajax-post btn-success btn-block" id="submit" type="submit" target-form="form">确 定 排 序</button>
        <!-- <button class="btn btn-return" onclick="javascript:history.back(-1);return false;">返 回</button> -->
    </div>
</block>

<block name="script">
    <script src="__STATIC__/thinkbox/jquery.thinkbox.js"></script>

    <script type="text/javascript">
    //搜索功能
    $("#search").click(function(){
        var url = $(this).attr('url');
        var query  = $('.search-form').find('input').serialize();
        query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g,'');
        query = query.replace(/^&/g,'');

        var game  = $('.search-form').find('select').serialize();
        game = game.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g,'');
        game = game.replace(/^&/g,'');

        if( url.indexOf('?')>0 ){
            url += '&' + query + '&' + game;
        }else{
            url += '?' + query + '&' + game;
        }
        window.location.href = url;
    });
    //回车搜索
    $(".search-input").keyup(function(e){
        if(e.keyCode === 13){
            $("#search").click();
            return false;
        }
    });
    //导航高亮
    highlight_subnav('{:U('index')}');
    </script>
</block>
